
<script language="javascript">
function initializeBody(){      	
        var extent 			= new OpenLayers.Bounds( <?=AVL_BOUNDS?>);
        var tempScales 		= <?=AVL_SCALES_LIST?>;
		projection 			= new OpenLayers.Projection("EPSG:4326"); 
       	displayProjection 	= new OpenLayers.Projection("EPSG:4326");

 
    	var vMapOptions = new Array();
    	var vCalles		= new Array();
    	var vSelectMenu	= new Array();

		//var callesUrl = "http://192.168.2.83:8008/mapguide/mapagent/mapagent.fcgi?USERNAME=Administrator&PASSWORD=admin&";
		var callesUrl 	= "http://<?=AVL_MAP_SERVER_IP?>:<?=AVL_MAP_SERVER_PORT?>/mapguide/mapagent/mapagent.fcgi?USERNAME=<?=AVL_MAP_SERVER_ADMIN?>&PASSWORD=<?=AVL_MAP_SERVER_PASSW?>&";
        var callesParams= {
        	mapdefinition: '<?=AVL_MAP_DEFINITION?>',
        	basemaplayergroupname: "<?=AVL_MAP_BASE_LAYER_GROUP?>"
        }
        var callesOptions = {
        	singleTile: false 
        }

        
        for(var i=0;i<cantMapas;i++){
        	vMapOptions[i] =  {
			        			projection: projection,
			        			displayProjection: displayProjection,
			                	maxExtent: extent, 
			                    scales: tempScales         
			                  };
			cMapController.getMapById(i).setMap(new OpenLayers.Map( 'map_canvas'+i, vMapOptions[i] ));
			cMapController.getMapById(i).setCalles(new OpenLayers.Layer.MapGuide( "Bykom Maps Calles", callesUrl, callesParams, callesOptions ));
			cMapController.getMapById(i).getMap().addLayer(cMapController.getMapById(i).getCalles()); 
			cMapController.getMapById(i).setSelectToolsMenu(new OpenLayers.Control.SelectSwitcher({buttonText:'Mapa', width:'100px'}));
			cMapController.getMapById(i).getSelectToolsMenu().addItem('Calles',function(){
											cMapController.getMapActive().getMap().setBaseLayer(cMapController.getMapActive().getCalles());
											},"clickMap2('" + i + "')"
								);
			cMapController.getMapById(i).getMap().addControl(cMapController.getMapById(i).getSelectToolsMenu());
			cMapController.getMapById(i).setProjection(projection);
			cMapController.getMapById(i).setDisplayProjection(displayProjection);
        }
        cMapController.getMapById(1).setColorMenu("#CCCCCC");
        map	= new OpenLayers.Map( '', mapOptions );
}
		
function unloadBody(){

		}
</script>